home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 14059 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: news.urz.uni-heidelberg.de!usenet
  2. From: pstarzet@ix.urz.uni-heidelberg.de (Paul Starzetz)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: HELP !! Please !! Read Me !!!!
  5. Date: 28 Mar 1996 17:05:30 GMT
  6. Organization: University of Heidelberg, Germany
  7. Distribution: world
  8. Message-ID: <4jegsr$mrb@sun0.urz.uni-heidelberg.de>
  9. References: <4j7prk$j0h@ktk2.smartt.com>
  10. Reply-To: pstarzet@ix.urz.uni-heidelberg.de
  11. NNTP-Posting-Host: aixterm6.urz.uni-heidelberg.de
  12.  
  13. Simply use the C++ container classes, a variety of container classes are included, eg. binary trees.
  14. See your compiler documentation for more details.
  15. But be on alert: a binary tree can have a very bad height/no_of_item ratio, resulting in poor
  16. search times. Although it can bes howed, that a "random generated" BTree has aproximatelly a 
  17. logartihmic height (absolutelly only 40% heighter than a fully ballanced BTree), the mean height
  18. of a BTree after n insert&delete operations is only in Theta(sqrt(n)) (=> mean search time proportional to sqrt(n)) ! To achieve better results you should use some balanced tree structure, like
  19. a RB-Tree (Red-Black-Tree) or an AVL-Tree. Also some binary tree like Patricia-Tree (especially for
  20. pattern-matching applications) or simple Digital Tree would achieve better results.
  21. See R. Sedgewick "Algorithms", or similiar literature.
  22.  
  23.  
  24.  
  25.